﻿name = "窗体"
text = """import clr
clr.AddReference('WindowsFormsIntegration')
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
clr.AddReference('System')
clr.AddReference('IronPython.Wpf')
clr.AddReference('PresentationFramework')
clr.AddReference('PresentationCore')
from System.Windows.Forms import Form, DockStyle
from System.Windows.Forms.Integration import ElementHost
from System.Drawing import Point
from System.Windows.Controls import UserControl
import wpf

class {0}(Form):
    def __init__(self): 
        self.elementHost = ElementHost()
        self.elementHost.Child = Control1()
        self.elementHost.Location = Point(0, 0)
        self.elementHost.Dock = DockStyle.Fill
        self.Controls.Add(self.elementHost)

class Control1(UserControl):
    def __init__(self):
        from pycad.system import pye
        file = pye.findfile(__name__, '{0}.xaml')
        wpf.LoadComponent(self, file)"""